package com.qfedu.zf.app.service;

import com.qfedu.zf.app.config.OpenFeignConfig;
import com.qfedu.zf.common.param.CommentCreatDTO;
import com.qfedu.zf.common.param.PostDetails;
import com.qfedu.zf.common.param.PostPage;
import com.qfedu.zf.common.vo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * --- 天道酬勤 ---
 *
 * @author WangJingwen
 * @date 2024/6/20
 * @desc -- 代码敲烂 月薪过万--
 * @desc
 */
@FeignClient(value = "lc-lifeserver",configuration = OpenFeignConfig.class)
public interface PostPageFeign {

    @GetMapping("/life/postPage/all")
    List<PostPage> getAllPosts();



    @GetMapping("/life/postPage/{postPageId}")
    List<PostDetails> selectPostsDetailById(@PathVariable("postPageId") Long postPageId);

    @PostMapping("/life/postPage/{postPageId}/like")
    void likePost(@PathVariable("postPageId") Long postPageId);

    @GetMapping("/life/postPage/{postPageId}/commentList")
    R getAllComment(@PathVariable("postPageId") Long postPageId);

    @PostMapping("/life/postPage/{postPageId}/addComment")
    R addComment(@PathVariable("postPageId") Long postPageId,@RequestBody CommentCreatDTO commentCreatDTO);


}

